<%@page import="com.qububu.common.notice.dto.NoticeInfoDto"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<script type="text/javascript" src="<%=request.getContextPath()%>/resource/js/jquery/jquery-1.8.2.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/resource/js/ajax_constants.js"></script>
<script type="text/javascript">
function deleteNotice(id) {
	var isDelete = window.confirm("是否删除！！");
	if(isDelete){
		$.ajax({
			type: "post",
			url: "<%=request.getContextPath() %>/notice/admin/ajaxDeleteNotice",
			dataType: "json", 
			data: {"noticeId": id},
			success: function(res) {
				if (res.result == AjaxMsgConstants.SUCCESS) {
					deleteStyle(id);
				} else {
					alert("删除失败, 错误信息" + result.message);
				}
			}
		});
	}
}

function deleteStyle(id) {
	$("#"+id+" a").attr("href", "");
	$("#"+id).css({"background":"yellow", "text-decoration":"line-through"});
}
</script>
<%
List<NoticeInfoDto> siteList =(List<NoticeInfoDto>) request.getAttribute("siteList");
List<NoticeInfoDto> communityList =(List<NoticeInfoDto>) request.getAttribute("communityList");
%>    
<div style="width: 800px; min-height: 580px; height: auto !important; height: 580px; text-align: center; background: #FFFFFF;">
	<div style="height: 30px; width: 800px; line-height: 30px;"><a href="<%=request.getContextPath()%>/notice/admin/addSiteAndComm" target="_blank">发布公告</a></div>
	<div style="min-height: 500px; height: auto !important; height: 500px; width: 800px; margin-top: 10px; border: 1px solid #AED4F5;">
		<div style="height: 30px; width: 800px; line-height: 30px;"><h3>系统公告</h3></div>
			<div style="width:800px;height: 30px;">
				<div style="width: 200px;height: 30px;float: left;">标题</div>
				<div style="width: 400px;height: 30px;float: left;">内容概要</div>
				<div style="width: 100px;height: 30px;float: left;">发布时间</div>
				<div style="width: 100px;height: 30px;float: left;">操作</div>
				<div style="clear:both;"></div>
			</div>
			<%
				for(NoticeInfoDto siteNotice: siteList){
			%>
			<div id="<%=siteNotice.getNoticeId()  %>" style="width:800px; min-height: 100px; height: auto !important; height: 100px; margin: 5px 0;">
				<div style="width: 200px;height: 100px;float: left;">
					<a href="<%=request.getContextPath()%>/notice/showNoticeInfo?noticeId=<%=siteNotice.getNoticeId()%>" target="_blank"><%=siteNotice.getNoticeTitle() %></a>
				</div>
				<div style="width: 400px;min-height: 100px; height: auto !important; height: 100px;float: left;"><%=siteNotice.getNoticeSummaryText()%></div>
				<div style="width: 100px;height: 100px;float: left;"><%=siteNotice.showNoticeCreateDttmInString() %></div>
				<div style="width: 100px;height: 100px;float: left;"><a href="javascript:deleteNotice('<%=siteNotice.getNoticeId() %>')">删除</a></div>
				<div style="clear:both;"></div>
			</div>
			<div style="height: 0; width: 780px; margin-left: 10px; border-bottom: 1px dashed #AED4F5;"></div>
			<%
				}
			%>
		<div style="height: 0; width: 800px; border-bottom: 1px solid red; margin: 20px 0;"></div>
		
		<div style="height: 30px; width: 800px; line-height: 30px;"><h3>社区活动</h3></div>
		<div style="width:800px;height: 30px;">
				<div style="width: 200px;height: 30px;float: left;">标题</div>
				<div style="width: 400px;height: 30px;float: left;">内容概要</div>
				<div style="width: 100px;height: 30px;float: left;">发布时间</div>
				<div style="width: 100px;height: 30px;float: left;">操作</div>
				<div style="clear:both;"></div>
			</div>
		<%
				for(NoticeInfoDto commNotice: communityList){
			%>
			<div id="<%=commNotice.getNoticeId()  %>" style="width:800px;height: 100px;">
				<div style="width: 200px;height: 100px;float: left;">
					<a href="<%=request.getContextPath()%>/notice/showNoticeInfo?noticeId=<%=commNotice.getNoticeId()%>" target="_blank"><%=commNotice.getNoticeTitle() %></a>
				</div>
				<div style="width: 400px;height: 100px;float: left;"><%=commNotice.getNoticeSummaryText()%></div>
				<div style="width: 100px;height: 100px;float: left;"><%=commNotice.showNoticeCreateDttmInString() %></div>
				<div style="width: 100px;height: 100px;float: left;"><a href="javascript:deleteNotice('<%=commNotice.getNoticeId() %>')">删除</a></div>
				<div style="clear:both;"></div>
			</div>
			<%
				}
			%>
		<div style="height: 0; width: 800px; border-bottom: 1px solid #AED4F5;"></div>
		
		<!--<div style="height: 30px; width: 800px; line-height: 30px;">特别推荐</div>
		<div style="width:1000px;height: 30px;">
				<div style="width: 200px;height: 30px;float: left;">标题</div>
				<div style="width: 400px;height: 30px;float: left;">内容概要</div>
				<div style="width: 100px;height: 30px;float: left;">发布时间</div>
				<div style="width: 100px;height: 30px;float: left;">操作</div>
				<div style="clear;both;"></div>
			</div>
			
		
	--></div>
</div>